#include <AVUITransform3D.h>
#include <AVUIMatrix3D.h>

namespace AVUI {

class MatrixTransform3D : public Transform3D
{
public:
    MatrixTransform3D();
    MatrixTransform3D(const Matrix3D& matrix);

    ~MatrixTransform3D() { }

    virtual Matrix3D get_Value();

    DECLARE_ELEMENT(MatrixTransform3D, Transform3D);

    bool get_IsAffine() { return m_matrix.get_IsAffine(); }

    virtual void Append(Matrix3D* pMatrix) AVUI_OVERRIDE
    {
        *pMatrix = *pMatrix * get_Value();
    }

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<MatrixTransform3D>().get_Ptr(); }

private:
    Matrix3D m_matrix;
};

}; // namespace AVUI
